package com.gongzhiyun.springboot3test.mapper.message;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gongzhiyun.springboot3test.entity.message.TbMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TbMessageMapper extends BaseMapper<TbMessage> {
    //增加，取消点赞数
    @Update("update tb_message set praise=praise+1 where id=#{mid}")
    int addPraise(Integer mid);

    @Update("update tb_message set praise=praise-1 where id=#{mid}")
    int DecPraise(Integer mid);

    //增加，减少reply
    @Update("update tb_message set reply=reply+1 where id=#{mid}")
    int addReply(Integer mid);

    @Update("update tb_message set reply=reply-1 where id=#{mid}")
    int DecReply(Integer mid);
}
